package gostd

import "sync"

// Mutex stderr.
var errMutex = new(sync.Mutex)

// Mutex control stderr.
func Err() Toggle {
	return Toggle{
		Lock: func() {
			errMutex.Lock()
		},
		TryLock: func() {
			errMutex.TryLock()
		},
		Unlock: func() {
			errMutex.Unlock()
		},
	}
}
